package edu.java.texbooks.scjp.threads.test15;

public class MyThread implements Runnable {

	@Override
	public synchronized void run() {
		String threadName = Thread.currentThread().getName();
		System.out.println(threadName + " has run. ");

		System.out.println(threadName + " is going to wait.");

		try {
			this.wait();
			System.out.println("----------- Print ----------" + threadName);
		} catch (InterruptedException ie) {
			System.out.println(threadName + " is interrupted.");
		}
	}
}
